package com.example.sicnuaccountingapp.utils

import android.view.View
import com.google.android.material.transition.MaterialContainerTransform
import com.google.android.material.transition.MaterialElevationScale

object MaterialContainerTransformUtils {
    fun buildContainerTransform(
        startViewArg: View,
        endViewArg: View,
        entering: Boolean
    ): MaterialContainerTransform {
        return MaterialContainerTransform().apply {
            startView = if (entering) startViewArg else endViewArg
            endView = if (entering) endViewArg else startViewArg
            addTarget(if (entering) endViewArg else startViewArg)
            duration = 300L
            scrimColor = android.graphics.Color.TRANSPARENT
            fadeMode = MaterialContainerTransform.FADE_MODE_THROUGH
            drawingViewId = android.R.id.content
        }
    }

    fun buildElevationScale(entering: Boolean): MaterialElevationScale {
        return MaterialElevationScale(entering).apply {
            duration = 300L
        }
    }
} 